// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   DatabaseConnectionSet.java

package org.quickserver.util.xmlreader;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;

// Referenced classes of package org.quickserver.util.xmlreader:
//            DatabaseConnectionConfig

public class DatabaseConnectionSet
    implements Serializable
{

    public DatabaseConnectionSet()
    {
        databaseConnectionSet = null;
        databaseConnectionSet = new ArrayList();
    }

    public void addDatabaseConnection(DatabaseConnectionConfig dbcConfig)
    {
        if(dbcConfig != null)
            databaseConnectionSet.add(dbcConfig);
    }

    public Iterator iterator()
    {
        return databaseConnectionSet.iterator();
    }

    public String toXML(String pad)
    {
        if(pad == null)
            pad = "";
        StringBuilder sb = new StringBuilder();
        sb.append(pad).append("<database-connection-set>\n");
        DatabaseConnectionConfig dcc;
        for(Iterator iterator = iterator(); iterator.hasNext(); sb.append(dcc.toXML((new StringBuilder(String.valueOf(pad))).append("\t").toString())))
            dcc = (DatabaseConnectionConfig)iterator.next();

        sb.append(pad).append("</database-connection-set>\n");
        return sb.toString();
    }

    private ArrayList databaseConnectionSet;
}
